package com.crm.jdy.service.project;

import com.crm.jdy.common.dto.ProjectTaskInfoDto;
import com.crm.jdy.common.pojo.ProjectTaskInfo;
import com.crm.jdy.common.mapper.ProjectTaskInfoMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.dubbo.config.annotation.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**   
 * @Description:(项目任务信息服务实现)
 *
 * @version: V1.0
 * @author: kong
 * 
 */
@Service(version = "${service.version}")
@Component
public class ProjectTaskInfoServiceImpl  extends ServiceImpl<ProjectTaskInfoMapper,ProjectTaskInfo> implements ProjectTaskInfoService  {

    @Autowired
    ProjectTaskInfoMapper projectTaskInfoDao;


    @Override
    public PageInfo<ProjectTaskInfo> seleteProjectTaskInfo(ProjectTaskInfoDto projectInfoDto) {
        PageHelper.startPage( projectInfoDto.getCurrentPage(),projectInfoDto.getPageSize());
        List<ProjectTaskInfo> bookList = projectTaskInfoDao.seleteProjectTaskInfo(projectInfoDto);
        PageInfo<ProjectTaskInfo> pageInfo = new PageInfo<ProjectTaskInfo>(bookList);
        return pageInfo;
    }

    @Override
    public boolean updateProjectTaskInfo(ProjectTaskInfo projectInfo) {
        return projectTaskInfoDao.updateById(projectInfo) > 0;
    }

    @Override
    public boolean addProjectTaskInfo(ProjectTaskInfo projectInfo) {
        return projectTaskInfoDao.insert(projectInfo) > 0;
    }

    @Override
    public boolean removeProjectTaskInfo(String proId) {
        return projectTaskInfoDao.deleteById(proId) > 0;
    }

}